﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace java.util
{
    public class Character
    {
        private static readonly Regex startRegex = new Regex(@"(\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl})");
        private static readonly Regex partRegex = new Regex(@"(\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf})");

        public static bool IsJavaIdentifierStart(char c)
        {
            return startRegex.IsMatch(c.ToString());
        }

        public static bool IsJavaIdentifierPart(char c)
        {
            return partRegex.IsMatch(c.ToString());
        }
    }
}
